# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Jenneron <jenneron@protonmail.com>
pkgname=device-google-gru
pkgdesc="Google Gru Chromebooks"
pkgver=8
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
	alsa-ucm-conf-google-gru
	depthcharge-tools
	eudev-hwids>=3.2.12-r0
	linux-postmarketos-rockchip
	postmarketos-base
	postmarketos-cros-common
	soc-rockchip-rk3399
"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="deviceinfo modules-initfs"

# provides and replaces to switch old installations to this package
provides="
	device-google-dru=$pkgver-r$pkgrel
	device-google-druwl=$pkgver-r$pkgrel
	device-google-dumo=$pkgver-r$pkgrel
	device-google-kevin=$pkgver-r$pkgrel
	device-google-bob=$pkgver-r$pkgrel
"
replaces="
	device-google-dru
	device-google-druwl
	device-google-dumo
	device-google-kevin
	device-google-bob
"

build() {
	devicepkg_build $startdir $pkgname
}

package() {
	devicepkg_package $startdir $pkgname
}

nonfree_firmware() {
	pkgdesc="WiFi/BT and DP firmware"
	depends="linux-firmware-ath10k linux-firmware-qca linux-firmware-mrvl linux-firmware-rockchip"
	mkdir "$subpkgdir"
}


sha512sums="
d0d5e47e7bc6f63f92669a315611c36972e2f06a32c1339ac551f23db023331fb6e1cdbbe4dc2022596aaf8083967951c43585a3aa32c4fddc8d8987bc20c092  deviceinfo
a750a0c41068082e0b82351d5aec91715e1a5215b09b26fec644dfe259cea2d662e878433a732a8c06dab2a9b420baec2bcc6161d8357cf3ed770239c5165090  modules-initfs
"
